package com.htjc.uep.center.model.result;

import com.htjc.uep.center.model.enums.ResultErrorStatus;
import com.htjc.uep.center.model.enums.ResultSuccessStatus;

public class BaseResultModel {
	
	private Integer code;
	
	private String message;
	
	private Object data;

	public Integer getCode() {
		return code;
	}

	public String getMessage() {
		return message;
	}

	public Object getData() {
		return data;
	}

	public BaseResultModel() {
		this.code = 0;
		this.message = "";
		this.data = "";
	}
	
	public BaseResultModel(Integer code, String message, Object data) {
		this.code = code;
		this.message = message;
		this.data = data;
	}
	
	public BaseResultModel(Integer code, String message) {
		this.code = code;
		this.message = message;
		this.data = "";
	}
	
	public BaseResultModel(Integer code) {
		this.code = code;
	}
	
	public static BaseResultModel resultSuccess(Object obj) {
		return new BaseResultModel(ResultSuccessStatus.SUCCESS.getCode(), ResultSuccessStatus.SUCCESS.getMessage(), obj);
	}
	
	public static BaseResultModel resultError(ResultErrorStatus status, Object obj) {
		return new BaseResultModel(status.getCode(), status.getMessage(), obj);
	}
}




























